package com.github.pig.admin.service.pay.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pig.admin.mapper.pay.PaymentRecordMapper;
import com.github.pig.admin.model.entity.PaymentRecord;
import com.github.pig.admin.service.pay.IPaymentRecordService;
import com.github.pig.common.constant.CommonConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 缴费记录表 服务实现类
 * </p>
 *
 * @author xiaosa
 * @since 2018-07-19
 */
@Service
public class PaymentRecordServiceImpl extends ServiceImpl<PaymentRecordMapper, PaymentRecord> implements IPaymentRecordService {

    @Autowired
    private PaymentRecordMapper mapper;

    @Override
    public Page<PaymentRecord> indexPage(Page<PaymentRecord> page, String userName) {

        PaymentRecord paymentRecord = new PaymentRecord();
        paymentRecord.setDelFlag(CommonConstant.STATUS_NORMAL);
        paymentRecord.setPayUser(userName);
        List<PaymentRecord> list = mapper.selectPages(page,paymentRecord);
        return page.setRecords(list);
    }

}
